<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .box1{
            border: 10px red solid;
        }

        .box2{
            float: left;
            width: 200px;
            height: 200px;
            background-color: #bfa;
        }

        .clearfix::after{
            content: "";
            display: block;
            clear: both;
        }
    </style>
</head>
<body>
<div class="box1 clearfix">
    <div class="box2"></div>
</div>
</body>
</html>